#pragma once

#include "../Core/Mesh.h"
#include "../Core/Rectangle.h"
#include "BufferHint.h"
#include "ClearState.h"
#include "TextureUnits.h"
#include "DrawCommand.h"
#include "SceneState.h"
#include "ShaderVertexAttributeCollection.h"
#include "MeshBuffers.h"

#include "Device.h"

namespace Renderer
{
	using namespace Core;

	class Context
	{
	public:
		Context();

		virtual void Clear(ClearState* clearState);
		virtual void Draw(PrimitiveType primitiveType, int offset, int count, Renderer::DrawCommand* drawCommand, SceneState* sceneState) = 0;
		virtual void Draw(PrimitiveType primitiveType, Renderer::DrawCommand* drawCommand, SceneState* sceneState) = 0;
		
		virtual VertexArray* CreateVertexArray(Mesh* mesh, ShaderVertexAttributeCollection* shaderAttributes, BufferHint usageHint);

		virtual VertexArray* CreateVertexArray(Renderer::MeshBuffers* meshBuffers);

		virtual VertexArray* CreateVertexArray() = 0;

		virtual void Ignore1282() = 0;

		virtual TextureUnits* GetTextureUnits() const = 0;

		//virtual FrameBuffer CreateFramebuffer() = 0;

		virtual Core::Rectangle GetViewport() const;
		virtual void SetViewport(const Core::Rectangle& viewport) = 0;

	protected:
		//TextureUnits* _textureUnits;
		Core::Rectangle _viewport;
		//Framebuffer* _frameBuffer;
		
	};
}